﻿namespace Resharper.Abstractions.Daemons
{
  using JetBrains.DocumentModel;
  using JetBrains.ReSharper.Daemon;
  using JetBrains.ReSharper.Daemon.CSharp.Errors;
  using Resharper.Abstractions.CodeDom.TreeNodes;

  /// <summary>Defines the <see cref="HighlightBase"/> class.</summary>
  public abstract class HighlightBase : CSharpHighlightingBase, IHighlighting
  {
    /// <summary>Initializes a new instance of the <see cref="HighlightBase"/> class.</summary>
    protected internal HighlightBase()
    {
    }

    #region Implemented Interfaces

    #region IHighlighting

    /// <summary>
    /// Gets or sets the tool tip.
    /// </summary>
    /// <value>The tool tip.</value>
    public string ToolTip { get; set; }

    /// <summary>
    /// Message for this highlighting to show in tooltip and in status bar (if <see cref="P:JetBrains.ReSharper.Daemon.HighlightingAttributeBase.ShowToolTipInStatusBar"/> is <c>true</c>)
    /// </summary>
    public string ErrorStripeToolTip
    {
      get
      {
        return this.ToolTip;
      }
    }

    /// <summary>
    /// Specifies the offset from the Range.StartOffset to set the cursor to when navigating
    /// to this highlighting. Usually returns <c>0</c>
    /// </summary>
    public int NavigationOffsetPatch
    {
      get
      {
        return 0;
      }
    }

    #endregion

    #endregion

    #region Properties

    /// <summary>
    /// Gets or sets the range.
    /// </summary>
    /// <value>The range.</value>
    public Range Range { get; set; }

    /// <summary>
    /// Gets or sets the document.
    /// </summary>
    /// <value>The document.</value>
    internal IDocument InternalDocument { get; set; }

    #endregion

    #region Implemented Interfaces

    #region IHighlighting

    /// <summary>Returns true if data (PSI, text ranges) associated with highlighting is valid</summary>
    /// <returns>Returns <c>true</c>, if successful, otherwise <c>false</c>.</returns>
    public override bool IsValid()
    {
      return true;
    }

    #endregion

    #endregion
  }
}